package com.example.product_practices.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.product_practices.domain.Questionnaire;
import com.example.product_practices.mapper.QuestionnaireMapper;
import com.example.product_practices.mapper.UserMapper;
import com.example.product_practices.service.IQuestionnaireService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

@Service
public class QuestionnaireServiceImpl extends ServiceImpl<QuestionnaireMapper, Questionnaire> implements IQuestionnaireService {
    @Override
    public boolean removeByIds2(List<Integer> asList) {
        List<Integer> collect = asList.stream().filter(id -> this.baseMapper.selectById(id).getStatus() != 2).collect(Collectors.toList());
        return this.baseMapper.deleteBatchIds(collect)>0;
    }
    @Autowired
    QuestionnaireMapper questionnaireMapper;
    public int getId() {
        return questionnaireMapper.getId();
    }
}
